package com.watson.mvcdemo.demo;

import lombok.Data;

import java.util.List;

/**
 * @Description: TODO
 * @Author watson
 * @Date 2022/8/5 16:50
 * @Version 1.0
 */
@Data
public class DemoNode {
    protected int id;
    protected int parentId;
    List<DemoNode> children = null;

    public void add(DemoNode node) {
        if (!children.contains(node)) {
            children.add(node);
        }
    }
}
